-- 添加Buff种类, Buff名称, Buff中文名, Buff描述, Buff类型(buff, debuff), Buff处理函数, Buff失效执行函数, 相同Buff效果覆盖/叠加
function RegisterBuffType(name, name_cn, desc, buff_type, fn, end_fn, cover)
    assert(type(name) == "string" and string.match(name, "^%_?[%w_]+$"), "无效的Buff注册名")
    assert(name_cn == nil or type(name_cn) == "string", "无效的Buff名称")
    assert(desc == nil or type(desc) == "string", "无效的Buff描述")
    assert(type(buff_type) == "string" and string.match(buff_type, "^%_?[%w_]+$", "无效的Buff类型"))

    cover = cover ~= false

    if type(name) == "string" and type(buff_type) == "string" and type(fn) == "function" then
        if type(end_fn) ~= "function" then
            end_fn = false
        end
        TUNING.BUFF_FN_TYPES[name] = {
            name_cn = name_cn, desc = desc, type = buff_type, fn = fn, end_fn = end_fn, cover = cover
        }
    end
end
